/* eslint-disable */
/* 月亮 */
import { checkColor } from './unit'

/* 大月亮-全 */
export const moonFill = (moonColor, starColor) => {
  return [...starTemplate(starColor), moonTemplate('fill', moonColor)]
}
/* 大月亮-线 */
export const moonLine = (moonColor, starColor) => {
  return [...starTemplate(starColor), moonTemplate('line', moonColor)]
}
/* 小月亮-全 */
export const smallMoonFill = (color) => {
  return moonSmallTemplate('fill', color)
}
/* 小月亮-线 */
export const smallMoonLine = (color) => {
  return moonSmallTemplate('line', color)
}
/* 大月亮-模板 */
const moonTemplate = (type, color) => {
  const moonFill = moonFillTemplate(type, 'big', color)
  return {
    ddd: 0,
    ind: 4,
    ty: 4,
    nm: 'moon',
    sr: 1,
    ks: {
      o: {
        a: 0,
        k: 100,
        ix: 11
      },
      r: {
        a: 1,
        k: [
          {
            i: {
              x: [
                0.833
              ],
              y: [
                0.833
              ]
            },
            o: {
              x: [
                0.167
              ],
              y: [
                0.167
              ]
            },
            t: 0,
            s: [
              -15
            ]
          },
          {
            i: {
              x: [
                0.833
              ],
              y: [
                0.833
              ]
            },
            o: {
              x: [
                0.167
              ],
              y: [
                0.167
              ]
            },
            t: 180,
            s: [
              9
            ]
          },
          {
            t: 359,
            s: [
              -15
            ]
          }
        ],
        ix: 10
      },
      p: {
        a: 0,
        k: [
          256,
          256,
          0
        ],
        ix: 2
      },
      a: {
        a: 0,
        k: [
          0,
          0,
          0
        ],
        ix: 1
      },
      s: {
        a: 0,
        k: [
          90,
          90,
          90
        ],
        ix: 6
      }
    },
    ao: 0,
    shapes: [
      {
        ty: 'gr',
        it: [
          {
            ind: 0,
            ty: 'sh',
            ix: 1,
            ks: {
              a: 0,
              k: {
                i: [
                  [
                    4.989,
                    0
                  ],
                  [
                    0,
                    73.133
                  ],
                  [
                    -2.789,
                    10.632
                  ],
                  [
                    0,
                    -68.211
                  ],
                  [
                    -74.124,
                    0
                  ],
                  [
                    -14.959,
                    57.027
                  ]
                ],
                o: [
                  [
                    -74.124,
                    0
                  ],
                  [
                    0,
                    -11.492
                  ],
                  [
                    -67.179,
                    7.251
                  ],
                  [
                    0,
                    73.133
                  ],
                  [
                    62.476,
                    0
                  ],
                  [
                    -4.848,
                    0.523
                  ]
                ],
                v: [
                  [
                    117.254,
                    33.632
                  ],
                  [
                    -16.96,
                    -98.787
                  ],
                  [
                    -12.532,
                    -132
                  ],
                  [
                    -132,
                    -0.419
                  ],
                  [
                    2.214,
                    132
                  ],
                  [
                    132,
                    32.794
                  ]
                ],
                c: true
              },
              ix: 2
            },
            hd: false
          },
          ...moonFill,
          {
            ty: 'tr',
            p: {
              a: 0,
              k: [
                0,
                0
              ],
              ix: 2
            },
            a: {
              a: 0,
              k: [
                0,
                0
              ],
              ix: 1
            },
            s: {
              a: 0,
              k: [
                100,
                100
              ],
              ix: 3
            },
            r: {
              a: 0,
              k: 0,
              ix: 6
            },
            o: {
              a: 0,
              k: 100,
              ix: 7
            },
            sk: {
              a: 0,
              k: 0,
              ix: 4
            },
            sa: {
              a: 0,
              k: 0,
              ix: 5
            }
          }
        ],
        np: 3,
        cix: 2,
        bm: 0,
        ix: 1,
        hd: false
      }
    ],
    ip: 0,
    op: 360,
    st: 0,
    bm: 0
  }
}
/* 单色描边 */
const strokeTemplate = (strokeColor, strokeWidth) => {
  return {
    ty: 'st',
    c: {
      a: 0,
      k: strokeColor,
      ix: 3
    },
    o: {
      a: 0,
      k: 100,
      ix: 4
    },
    w: {
      a: 0,
      k: strokeWidth,
      ix: 5
    },
    lc: 2,
    lj: 2,
    bm: 0,
    hd: false
  }
}
/* 月亮描边宽度 */
const getMoonStrokeWidth = (type, size) => {
  return type === 'line' ? (size === 'small' ? 9 : 20) : (size === 'small' ? 4 : 6)
}
/* 大月亮-填充方式-单色描边/渐变填充/单色填充 */
const moonFillTemplate = (type, size, color) => {
  const moonStrokeWidth = getMoonStrokeWidth(type, size)
  const moonColor = color && checkColor(color) ? [color[0] / 255, color[1] / 255, color[2] / 255, 1] : [0.447058826685, 0.72549021244, 0.835294127464, 1]
  if (type === 'line') {
    return [strokeTemplate(moonColor, moonStrokeWidth)]
  } else {
    if (color && checkColor(color)) {
      return [strokeTemplate(moonColor, moonStrokeWidth), {
        ty: 'fl',
        c: {
          a: 0,
          k: moonColor,
          ix: 3
        },
        o: {
          a: 0,
          k: 100,
          ix: 4
        },
        w: {
          a: 0,
          k: 12,
          ix: 5
        },
        lc: 2,
        lj: 1,
        ml: 10,
        bm: 0,
        hd: false
      }]
    } else {
      const gradient_s_k = size === 'small' ? [-52, -68] : [-80.517, -105.871]
      const gradient_e_k = size === 'small' ? [32.541, 78.429] : [52.333, 124.231]
      return [strokeTemplate(moonColor, moonStrokeWidth), {
        ty: 'gf',
        o: {
          a: 0,
          k: 100,
          ix: 10
        },
        r: 1,
        bm: 0,
        g: {
          p: 5,
          k: {
            a: 0,
            k: [
              0,
              0.525,
              0.765,
              0.859,
              0.225,
              0.525,
              0.765,
              0.859,
              0.45,
              0.525,
              0.765,
              0.859,
              0.725,
              0.447,
              0.725,
              0.835,
              1,
              0.369,
              0.686,
              0.812
            ],
            ix: 9
          }
        },
        s: {
          a: 0,
          k: gradient_s_k,
          ix: 5
        },
        e: {
          a: 0,
          k: gradient_e_k,
          ix: 6
        },
        t: 1,
        hd: false
      }]
    }
  }
}
/* 星星-模板 */
const starTemplate = (color) => {
  return [
    {
      ddd: 0,
      ind: 1,
      ty: 4,
      nm: 'star-3',
      sr: 1,
      ks: {
        o: {
          a: 1,
          k: [
            {
              i: {
                x: [
                  0.667
                ],
                y: [
                  1
                ]
              },
              o: {
                x: [
                  0.333
                ],
                y: [
                  0
                ]
              },
              t: -339,
              s: [
                100
              ]
            },
            {
              i: {
                x: [
                  0.667
                ],
                y: [
                  1
                ]
              },
              o: {
                x: [
                  0.333
                ],
                y: [
                  0
                ]
              },
              t: -279,
              s: [
                75
              ]
            },
            {
              i: {
                x: [
                  0.667
                ],
                y: [
                  1
                ]
              },
              o: {
                x: [
                  0.333
                ],
                y: [
                  0
                ]
              },
              t: -219,
              s: [
                100
              ]
            },
            {
              i: {
                x: [
                  0.667
                ],
                y: [
                  1
                ]
              },
              o: {
                x: [
                  0.333
                ],
                y: [
                  0
                ]
              },
              t: -159,
              s: [
                75
              ]
            },
            {
              i: {
                x: [
                  0.667
                ],
                y: [
                  1
                ]
              },
              o: {
                x: [
                  0.333
                ],
                y: [
                  0
                ]
              },
              t: -99,
              s: [
                100
              ]
            },
            {
              i: {
                x: [
                  0.667
                ],
                y: [
                  1
                ]
              },
              o: {
                x: [
                  0.333
                ],
                y: [
                  0
                ]
              },
              t: -39,
              s: [
                75
              ]
            },
            {
              i: {
                x: [
                  0.667
                ],
                y: [
                  1
                ]
              },
              o: {
                x: [
                  0.333
                ],
                y: [
                  0
                ]
              },
              t: 20,
              s: [
                100
              ]
            },
            {
              i: {
                x: [
                  0.667
                ],
                y: [
                  1
                ]
              },
              o: {
                x: [
                  0.333
                ],
                y: [
                  0
                ]
              },
              t: 80,
              s: [
                75
              ]
            },
            {
              i: {
                x: [
                  0.667
                ],
                y: [
                  1
                ]
              },
              o: {
                x: [
                  0.333
                ],
                y: [
                  0
                ]
              },
              t: 140,
              s: [
                100
              ]
            },
            {
              i: {
                x: [
                  0.667
                ],
                y: [
                  1
                ]
              },
              o: {
                x: [
                  0.333
                ],
                y: [
                  0
                ]
              },
              t: 200,
              s: [
                75
              ]
            },
            {
              i: {
                x: [
                  0.667
                ],
                y: [
                  1
                ]
              },
              o: {
                x: [
                  0.333
                ],
                y: [
                  0
                ]
              },
              t: 260,
              s: [
                100
              ]
            },
            {
              i: {
                x: [
                  0.667
                ],
                y: [
                  1
                ]
              },
              o: {
                x: [
                  0.333
                ],
                y: [
                  0
                ]
              },
              t: 320,
              s: [
                75
              ]
            },
            {
              t: 379,
              s: [
                100
              ]
            }
          ],
          ix: 11
        },
        r: {
          a: 1,
          k: [
            {
              i: {
                x: [
                  0.667
                ],
                y: [
                  1
                ]
              },
              o: {
                x: [
                  0.333
                ],
                y: [
                  0
                ]
              },
              t: -339,
              s: [
                -15
              ]
            },
            {
              i: {
                x: [
                  0.667
                ],
                y: [
                  1
                ]
              },
              o: {
                x: [
                  0.333
                ],
                y: [
                  0
                ]
              },
              t: -159,
              s: [
                15
              ]
            },
            {
              i: {
                x: [
                  0.667
                ],
                y: [
                  1
                ]
              },
              o: {
                x: [
                  0.333
                ],
                y: [
                  0
                ]
              },
              t: 20,
              s: [
                -15
              ]
            },
            {
              i: {
                x: [
                  0.667
                ],
                y: [
                  1
                ]
              },
              o: {
                x: [
                  0.333
                ],
                y: [
                  0
                ]
              },
              t: 200,
              s: [
                15
              ]
            },
            {
              t: 379,
              s: [
                -15
              ]
            }
          ],
          ix: 10
        },
        p: {
          a: 0,
          k: [
            372,
            222,
            0
          ],
          ix: 2
        },
        a: {
          a: 0,
          k: [
            0,
            0,
            0
          ],
          ix: 1
        },
        s: {
          a: 0,
          k: [
            90,
            90,
            90
          ],
          ix: 6
        }
      },
      ao: 0,
      shapes: [
        {
          ind: 0,
          ty: 'sh',
          ix: 1,
          ks: {
            a: 0,
            k: {
              i: [
                [
                  -1.758,
                  -0.489
                ],
                [
                  0,
                  0
                ],
                [
                  -0.169,
                  -0.608
                ],
                [
                  0,
                  0
                ],
                [
                  -0.489,
                  1.757
                ],
                [
                  0,
                  0
                ],
                [
                  -0.608,
                  0.169
                ],
                [
                  0,
                  0
                ],
                [
                  1.758,
                  0.489
                ],
                [
                  0,
                  0
                ],
                [
                  0.169,
                  0.608
                ],
                [
                  0,
                  0
                ],
                [
                  0.489,
                  -1.758
                ],
                [
                  0,
                  0
                ],
                [
                  0.608,
                  -0.169
                ],
                [
                  0,
                  0
                ]
              ],
              o: [
                [
                  0,
                  0
                ],
                [
                  0.608,
                  0.169
                ],
                [
                  0,
                  0
                ],
                [
                  0.489,
                  1.757
                ],
                [
                  0,
                  0
                ],
                [
                  0.169,
                  -0.608
                ],
                [
                  0,
                  0
                ],
                [
                  1.758,
                  -0.489
                ],
                [
                  0,
                  0
                ],
                [
                  -0.608,
                  -0.169
                ],
                [
                  0,
                  0
                ],
                [
                  -0.489,
                  -1.758
                ],
                [
                  0,
                  0
                ],
                [
                  -0.169,
                  0.608
                ],
                [
                  0,
                  0
                ],
                [
                  -1.758,
                  0.489
                ]
              ],
              v: [
                [
                  -34.682,
                  1.735
                ],
                [
                  -9.884,
                  8.632
                ],
                [
                  -8.632,
                  9.884
                ],
                [
                  -1.735,
                  34.682
                ],
                [
                  1.735,
                  34.682
                ],
                [
                  8.632,
                  9.884
                ],
                [
                  9.884,
                  8.632
                ],
                [
                  34.682,
                  1.735
                ],
                [
                  34.682,
                  -1.735
                ],
                [
                  9.884,
                  -8.632
                ],
                [
                  8.632,
                  -9.884
                ],
                [
                  1.735,
                  -34.682
                ],
                [
                  -1.735,
                  -34.682
                ],
                [
                  -8.632,
                  -9.884
                ],
                [
                  -9.884,
                  -8.632
                ],
                [
                  -34.682,
                  -1.735
                ]
              ],
              c: true
            },
            ix: 2
          },
          hd: false
        },
        ...starFillTemplate(3, color)
      ],
      ip: 0,
      op: 360,
      st: 0,
      bm: 0
    },
    {
      ddd: 0,
      ind: 2,
      ty: 4,
      nm: 'star-2',
      sr: 1,
      ks: {
        o: {
          a: 1,
          k: [
            {
              i: {
                x: [
                  0.667
                ],
                y: [
                  1
                ]
              },
              o: {
                x: [
                  0.333
                ],
                y: [
                  0
                ]
              },
              t: -319,
              s: [
                100
              ]
            },
            {
              i: {
                x: [
                  0.667
                ],
                y: [
                  1
                ]
              },
              o: {
                x: [
                  0.333
                ],
                y: [
                  0
                ]
              },
              t: -259,
              s: [
                75
              ]
            },
            {
              i: {
                x: [
                  0.667
                ],
                y: [
                  1
                ]
              },
              o: {
                x: [
                  0.333
                ],
                y: [
                  0
                ]
              },
              t: -199,
              s: [
                100
              ]
            },
            {
              i: {
                x: [
                  0.667
                ],
                y: [
                  1
                ]
              },
              o: {
                x: [
                  0.333
                ],
                y: [
                  0
                ]
              },
              t: -139,
              s: [
                75
              ]
            },
            {
              i: {
                x: [
                  0.667
                ],
                y: [
                  1
                ]
              },
              o: {
                x: [
                  0.333
                ],
                y: [
                  0
                ]
              },
              t: -79,
              s: [
                100
              ]
            },
            {
              i: {
                x: [
                  0.667
                ],
                y: [
                  1
                ]
              },
              o: {
                x: [
                  0.333
                ],
                y: [
                  0
                ]
              },
              t: -19,
              s: [
                75
              ]
            },
            {
              i: {
                x: [
                  0.667
                ],
                y: [
                  1
                ]
              },
              o: {
                x: [
                  0.333
                ],
                y: [
                  0
                ]
              },
              t: 40,
              s: [
                100
              ]
            },
            {
              i: {
                x: [
                  0.667
                ],
                y: [
                  1
                ]
              },
              o: {
                x: [
                  0.333
                ],
                y: [
                  0
                ]
              },
              t: 100,
              s: [
                75
              ]
            },
            {
              i: {
                x: [
                  0.667
                ],
                y: [
                  1
                ]
              },
              o: {
                x: [
                  0.333
                ],
                y: [
                  0
                ]
              },
              t: 160,
              s: [
                100
              ]
            },
            {
              i: {
                x: [
                  0.667
                ],
                y: [
                  1
                ]
              },
              o: {
                x: [
                  0.333
                ],
                y: [
                  0
                ]
              },
              t: 220,
              s: [
                75
              ]
            },
            {
              i: {
                x: [
                  0.667
                ],
                y: [
                  1
                ]
              },
              o: {
                x: [
                  0.333
                ],
                y: [
                  0
                ]
              },
              t: 280,
              s: [
                100
              ]
            },
            {
              i: {
                x: [
                  0.667
                ],
                y: [
                  1
                ]
              },
              o: {
                x: [
                  0.333
                ],
                y: [
                  0
                ]
              },
              t: 340,
              s: [
                75
              ]
            },
            {
              t: 399,
              s: [
                100
              ]
            }
          ],
          ix: 11
        },
        r: {
          a: 1,
          k: [
            {
              i: {
                x: [
                  0.667
                ],
                y: [
                  1
                ]
              },
              o: {
                x: [
                  0.333
                ],
                y: [
                  0
                ]
              },
              t: -319,
              s: [
                -15
              ]
            },
            {
              i: {
                x: [
                  0.667
                ],
                y: [
                  1
                ]
              },
              o: {
                x: [
                  0.333
                ],
                y: [
                  0
                ]
              },
              t: -139,
              s: [
                15
              ]
            },
            {
              i: {
                x: [
                  0.667
                ],
                y: [
                  1
                ]
              },
              o: {
                x: [
                  0.333
                ],
                y: [
                  0
                ]
              },
              t: 40,
              s: [
                -15
              ]
            },
            {
              i: {
                x: [
                  0.667
                ],
                y: [
                  1
                ]
              },
              o: {
                x: [
                  0.333
                ],
                y: [
                  0
                ]
              },
              t: 220,
              s: [
                15
              ]
            },
            {
              t: 399,
              s: [
                -15
              ]
            }
          ],
          ix: 10
        },
        p: {
          a: 0,
          k: [
            306,
            204,
            0
          ],
          ix: 2
        },
        a: {
          a: 0,
          k: [
            0,
            0,
            0
          ],
          ix: 1
        },
        s: {
          a: 0,
          k: [
            90,
            90,
            90
          ],
          ix: 6
        }
      },
      ao: 0,
      shapes: [
        {
          ind: 0,
          ty: 'sh',
          ix: 1,
          ks: {
            a: 0,
            k: {
              i: [
                [
                  -0.852,
                  -0.868
                ],
                [
                  0,
                  0
                ],
                [
                  0.105,
                  -0.408
                ],
                [
                  0,
                  0
                ],
                [
                  -0.868,
                  0.852
                ],
                [
                  0,
                  0
                ],
                [
                  -0.407,
                  -0.105
                ],
                [
                  0,
                  0
                ],
                [
                  0.852,
                  0.868
                ],
                [
                  0,
                  0
                ],
                [
                  -0.105,
                  0.407
                ],
                [
                  0,
                  0
                ],
                [
                  0.868,
                  -0.852
                ],
                [
                  0,
                  0
                ],
                [
                  0.407,
                  0.105
                ],
                [
                  0,
                  0
                ]
              ],
              o: [
                [
                  0,
                  0
                ],
                [
                  0.295,
                  0.3
                ],
                [
                  0,
                  0
                ],
                [
                  -0.304,
                  1.178
                ],
                [
                  0,
                  0
                ],
                [
                  0.3,
                  -0.295
                ],
                [
                  0,
                  0
                ],
                [
                  1.178,
                  0.304
                ],
                [
                  0,
                  0
                ],
                [
                  -0.295,
                  -0.3
                ],
                [
                  0,
                  0
                ],
                [
                  0.304,
                  -1.177
                ],
                [
                  0,
                  0
                ],
                [
                  -0.3,
                  0.294
                ],
                [
                  0,
                  0
                ],
                [
                  -1.178,
                  -0.304
                ]
              ],
              v: [
                [
                  -20.602,
                  -10.559
                ],
                [
                  -8.584,
                  1.689
                ],
                [
                  -8.278,
                  2.829
                ],
                [
                  -12.562,
                  19.445
                ],
                [
                  -10.559,
                  20.602
                ],
                [
                  1.689,
                  8.584
                ],
                [
                  2.829,
                  8.278
                ],
                [
                  19.445,
                  12.562
                ],
                [
                  20.602,
                  10.559
                ],
                [
                  8.584,
                  -1.689
                ],
                [
                  8.278,
                  -2.829
                ],
                [
                  12.562,
                  -19.445
                ],
                [
                  10.559,
                  -20.602
                ],
                [
                  -1.689,
                  -8.584
                ],
                [
                  -2.829,
                  -8.278
                ],
                [
                  -19.445,
                  -12.562
                ]
              ],
              c: true
            },
            ix: 2
          },
          hd: false
        },
        ...starFillTemplate(2, color)
      ],
      ip: 0,
      op: 360,
      st: 0,
      bm: 0
    },
    {
      ddd: 0,
      ind: 3,
      ty: 4,
      nm: 'star-1',
      sr: 1,
      ks: {
        o: {
          a: 1,
          k: [
            {
              i: {
                x: [
                  0.667
                ],
                y: [
                  1
                ]
              },
              o: {
                x: [
                  0.333
                ],
                y: [
                  0
                ]
              },
              t: 0,
              s: [
                100
              ]
            },
            {
              i: {
                x: [
                  0.667
                ],
                y: [
                  1
                ]
              },
              o: {
                x: [
                  0.333
                ],
                y: [
                  0
                ]
              },
              t: 60,
              s: [
                75
              ]
            },
            {
              i: {
                x: [
                  0.667
                ],
                y: [
                  1
                ]
              },
              o: {
                x: [
                  0.333
                ],
                y: [
                  0
                ]
              },
              t: 120,
              s: [
                100
              ]
            },
            {
              i: {
                x: [
                  0.667
                ],
                y: [
                  1
                ]
              },
              o: {
                x: [
                  0.333
                ],
                y: [
                  0
                ]
              },
              t: 180,
              s: [
                75
              ]
            },
            {
              i: {
                x: [
                  0.667
                ],
                y: [
                  1
                ]
              },
              o: {
                x: [
                  0.333
                ],
                y: [
                  0
                ]
              },
              t: 240,
              s: [
                100
              ]
            },
            {
              i: {
                x: [
                  0.667
                ],
                y: [
                  1
                ]
              },
              o: {
                x: [
                  0.333
                ],
                y: [
                  0
                ]
              },
              t: 300,
              s: [
                75
              ]
            },
            {
              t: 359,
              s: [
                100
              ]
            }
          ],
          ix: 11
        },
        r: {
          a: 1,
          k: [
            {
              i: {
                x: [
                  0.667
                ],
                y: [
                  1
                ]
              },
              o: {
                x: [
                  0.333
                ],
                y: [
                  0
                ]
              },
              t: 0,
              s: [
                -15
              ]
            },
            {
              i: {
                x: [
                  0.667
                ],
                y: [
                  1
                ]
              },
              o: {
                x: [
                  0.333
                ],
                y: [
                  0
                ]
              },
              t: 180,
              s: [
                15
              ]
            },
            {
              t: 359,
              s: [
                -15
              ]
            }
          ],
          ix: 10
        },
        p: {
          a: 0,
          k: [
            312,
            144,
            0
          ],
          ix: 2
        },
        a: {
          a: 0,
          k: [
            0,
            0,
            0
          ],
          ix: 1
        },
        s: {
          a: 0,
          k: [
            90,
            90,
            90
          ],
          ix: 6
        }
      },
      ao: 0,
      shapes: [
        {
          ind: 0,
          ty: 'sh',
          ix: 1,
          ks: {
            a: 0,
            k: {
              i: [
                [
                  -1.767,
                  0.455
                ],
                [
                  0,
                  0
                ],
                [
                  -0.451,
                  -0.442
                ],
                [
                  0,
                  0
                ],
                [
                  0.456,
                  1.767
                ],
                [
                  0,
                  0
                ],
                [
                  -0.442,
                  0.45
                ],
                [
                  0,
                  0
                ],
                [
                  1.767,
                  -0.455
                ],
                [
                  0,
                  0
                ],
                [
                  0.451,
                  0.442
                ],
                [
                  0,
                  0
                ],
                [
                  -0.456,
                  -1.766
                ],
                [
                  0,
                  0
                ],
                [
                  0.442,
                  -0.45
                ],
                [
                  0,
                  0
                ]
              ],
              o: [
                [
                  0,
                  0
                ],
                [
                  0.611,
                  -0.158
                ],
                [
                  0,
                  0
                ],
                [
                  1.302,
                  1.278
                ],
                [
                  0,
                  0
                ],
                [
                  -0.158,
                  -0.611
                ],
                [
                  0,
                  0
                ],
                [
                  1.278,
                  -1.302
                ],
                [
                  0,
                  0
                ],
                [
                  -0.611,
                  0.158
                ],
                [
                  0,
                  0
                ],
                [
                  -1.302,
                  -1.278
                ],
                [
                  0,
                  0
                ],
                [
                  0.158,
                  0.611
                ],
                [
                  0,
                  0
                ],
                [
                  -1.277,
                  1.302
                ]
              ],
              v: [
                [
                  -29.168,
                  18.844
                ],
                [
                  -4.244,
                  12.417
                ],
                [
                  -2.533,
                  12.876
                ],
                [
                  15.838,
                  30.903
                ],
                [
                  18.843,
                  29.168
                ],
                [
                  12.417,
                  4.244
                ],
                [
                  12.875,
                  2.533
                ],
                [
                  30.903,
                  -15.839
                ],
                [
                  29.168,
                  -18.844
                ],
                [
                  4.244,
                  -12.417
                ],
                [
                  2.533,
                  -12.876
                ],
                [
                  -15.838,
                  -30.903
                ],
                [
                  -18.843,
                  -29.168
                ],
                [
                  -12.418,
                  -4.244
                ],
                [
                  -12.876,
                  -2.533
                ],
                [
                  -30.903,
                  15.839
                ]
              ],
              c: true
            },
            ix: 2
          },
          hd: false
        },
        ...starFillTemplate(1, color)
      ],
      ip: 0,
      op: 360,
      st: 0,
      bm: 0
    }
  ]
}
/* 星星-填充方式-渐变填充/单色填充 */
const starFillTemplate = (index, color) => {
  const starStrokeWidth = 2
  const starColor = color && checkColor(color) ? [color[0] / 255, color[1] / 255, color[2] / 255, 1] : [0.988235294819, 0.827450990677, 0.301960796118, 1]
  if (color && checkColor(color)) {
    return [strokeTemplate(starColor, starStrokeWidth), {
      ty: 'fl',
      c: {
        a: 0,
        k: [color[0] / 255, color[1] / 255, color[2] / 255, 1],
        ix: 3
      },
      o: {
        a: 0,
        k: 100,
        ix: 4
      },
      w: {
        a: 0,
        k: 12,
        ix: 5
      },
      lc: 2,
      lj: 1,
      ml: 10,
      bm: 0,
      hd: false
    }]
  } else {
    return [strokeTemplate(starColor, starStrokeWidth), starGradientFillTemplate(index)]
  }
}
/* 星星-渐变填充模板 */
const starGradientFillTemplate = (index) => {
  // eslint-disable-next-line camelcase
  let gradient_s_k, gradient_e_k
  switch (index) {
    case 3: {
      gradient_s_k = [-16, -28]
      gradient_e_k = [15.427, 26.432]
      break
    }
    case 2: {
      gradient_s_k = [-11, -19]
      gradient_e_k = [9.951, 17.288]
      break
    }
    case 1: {
      gradient_s_k = [-18, -32]
      gradient_e_k = [18, 30.354]
      break
    }
  }
  return {
    ty: 'gf',
    o: {
      a: 0,
      k: 100,
      ix: 10
    },
    r: 1,
    bm: 0,
    g: {
      p: 5,
      k: {
        a: 0,
        k: [
          0,
          0.988,
          0.851,
          0.4,
          0.225,
          0.988,
          0.851,
          0.4,
          0.45,
          0.988,
          0.851,
          0.4,
          0.725,
          0.988,
          0.827,
          0.302,
          1,
          0.988,
          0.804,
          0.204
        ],
        ix: 9
      }
    },
    s: {
      a: 0,
      k: gradient_s_k,
      ix: 5
    },
    e: {
      a: 0,
      k: gradient_e_k,
      ix: 6
    },
    t: 1,
    hd: false
  }
}
/* 小月亮-模板 */
const moonSmallTemplate = (type, color) => {
  const moonFill = moonFillTemplate(type, 'small', color)
  const template = {
    ddd: 0,
    ind: 3,
    ty: 4,
    nm: 'moon',
    sr: 1,
    ks: {
      o: {
        a: 0,
        k: 100,
        ix: 11
      },
      r: {
        a: 0,
        k: 0,
        ix: 10
      },
      p: {
        a: 0,
        k: [
          154,
          207,
          0
        ],
        ix: 2,
        l: 2
      },
      a: {
        a: 0,
        k: [
          0,
          0,
          0
        ],
        ix: 1,
        l: 2
      },
      s: {
        a: 0,
        k: [
          100,
          100,
          100
        ],
        ix: 6,
        l: 2
      }
    },
    ao: 0,
    shapes: [
      {
        ty: 'gr',
        it: [
          {
            ind: 0,
            ty: 'sh',
            ix: 1,
            ks: {
              a: 0,
              k: {
                i: [
                  [
                    3.175,
                    0
                  ],
                  [
                    0,
                    46.539
                  ],
                  [
                    -1.775,
                    6.766
                  ],
                  [
                    0,
                    -43.407
                  ],
                  [
                    -47.17,
                    0
                  ],
                  [
                    -9.519,
                    36.29
                  ]
                ],
                o: [
                  [
                    -47.17,
                    0
                  ],
                  [
                    0,
                    -7.313
                  ],
                  [
                    -42.75,
                    4.614
                  ],
                  [
                    0,
                    46.539
                  ],
                  [
                    39.758,
                    0
                  ],
                  [
                    -3.085,
                    0.333
                  ]
                ],
                v: [
                  [
                    74.616,
                    21.402
                  ],
                  [
                    -10.793,
                    -62.865
                  ],
                  [
                    -7.975,
                    -84
                  ],
                  [
                    -84,
                    -0.267
                  ],
                  [
                    1.409,
                    84
                  ],
                  [
                    84,
                    20.869
                  ]
                ],
                c: true
              },
              ix: 2
            },
            hd: false
          },
          ...moonFill,
          {
            ty: 'tr',
            p: {
              a: 0,
              k: [
                0,
                0
              ],
              ix: 2
            },
            a: {
              a: 0,
              k: [
                0,
                0
              ],
              ix: 1
            },
            s: {
              a: 0,
              k: [
                100,
                100
              ],
              ix: 3
            },
            r: {
              a: 1,
              k: [
                {
                  i: {
                    x: [
                      0.833
                    ],
                    y: [
                      0.833
                    ]
                  },
                  o: {
                    x: [
                      0.167
                    ],
                    y: [
                      0.167
                    ]
                  },
                  t: 0,
                  s: [
                    -15
                  ]
                },
                {
                  i: {
                    x: [
                      0.833
                    ],
                    y: [
                      0.833
                    ]
                  },
                  o: {
                    x: [
                      0.167
                    ],
                    y: [
                      0.167
                    ]
                  },
                  t: 180,
                  s: [
                    9
                  ]
                },
                {
                  t: 359,
                  s: [
                    -15
                  ]
                }
              ],
              ix: 6
            },
            o: {
              a: 0,
              k: 100,
              ix: 7
            },
            sk: {
              a: 0,
              k: 0,
              ix: 4
            },
            sa: {
              a: 0,
              k: 0,
              ix: 5
            }
          }
        ],
        np: 2,
        cix: 2,
        bm: 0,
        ix: 1,
        hd: false
      }
    ],
    ip: 0,
    op: 360,
    st: 0,
    bm: 0
  }
  if (type === 'line') {
    template.hasMask = true
    template.masksProperties = [
      {
        inv: false,
        mode: 'a',
        pt: {
          a: 1,
          k: [
            {
              i: {
                x: 0.833,
                y: 0.833
              },
              o: {
                x: 0.167,
                y: 0.167
              },
              t: 0,
              s: [
                {
                  i: [
                    [
                      0,
                      0
                    ],
                    [
                      14.803,
                      -23.924
                    ],
                    [
                      10.461,
                      0
                    ],
                    [
                      0,
                      -30.928
                    ],
                    [
                      -0.484,
                      -2.963
                    ],
                    [
                      0,
                      -29.306
                    ],
                    [
                      0,
                      0
                    ],
                    [
                      0,
                      0
                    ],
                    [
                      0,
                      0
                    ]
                  ],
                  o: [
                    [
                      -30.201,
                      0
                    ],
                    [
                      -8.378,
                      -4.994
                    ],
                    [
                      -30.928,
                      0
                    ],
                    [
                      0,
                      3.1
                    ],
                    [
                      -27.779,
                      5.25
                    ],
                    [
                      0,
                      0
                    ],
                    [
                      0,
                      0
                    ],
                    [
                      0,
                      0
                    ],
                    [
                      0,
                      0
                    ]
                  ],
                  v: [
                    [
                      116.5,
                      -58.5
                    ],
                    [
                      45.096,
                      -18.585
                    ],
                    [
                      16.5,
                      -26.5
                    ],
                    [
                      -39.5,
                      29.5
                    ],
                    [
                      -38.699,
                      38.583
                    ],
                    [
                      -87.5,
                      97.5
                    ],
                    [
                      -159.5,
                      97.5
                    ],
                    [
                      -159.5,
                      -206.5
                    ],
                    [
                      116.5,
                      -206.5
                    ]
                  ],
                  c: true
                }
              ]
            },
            {
              i: {
                x: 0.833,
                y: 0.833
              },
              o: {
                x: 0.167,
                y: 0.167
              },
              t: 180,
              s: [
                {
                  i: [
                    [
                      0,
                      0
                    ],
                    [
                      14.803,
                      -23.924
                    ],
                    [
                      10.461,
                      0
                    ],
                    [
                      0,
                      -30.928
                    ],
                    [
                      -0.484,
                      -2.963
                    ],
                    [
                      0,
                      -29.306
                    ],
                    [
                      0,
                      0
                    ],
                    [
                      0,
                      0
                    ],
                    [
                      0,
                      0
                    ]
                  ],
                  o: [
                    [
                      -30.201,
                      0
                    ],
                    [
                      -8.378,
                      -4.994
                    ],
                    [
                      -30.928,
                      0
                    ],
                    [
                      0,
                      3.1
                    ],
                    [
                      -27.779,
                      5.25
                    ],
                    [
                      0,
                      0
                    ],
                    [
                      0,
                      0
                    ],
                    [
                      0,
                      0
                    ],
                    [
                      0,
                      0
                    ]
                  ],
                  v: [
                    [
                      152.5,
                      -58.5
                    ],
                    [
                      81.096,
                      -18.585
                    ],
                    [
                      52.5,
                      -26.5
                    ],
                    [
                      -3.5,
                      29.5
                    ],
                    [
                      -2.699,
                      38.583
                    ],
                    [
                      -51.5,
                      97.5
                    ],
                    [
                      -123.5,
                      97.5
                    ],
                    [
                      -123.5,
                      -206.5
                    ],
                    [
                      152.5,
                      -206.5
                    ]
                  ],
                  c: true
                }
              ]
            },
            {
              t: 359,
              s: [
                {
                  i: [
                    [
                      0,
                      0
                    ],
                    [
                      14.803,
                      -23.924
                    ],
                    [
                      10.461,
                      0
                    ],
                    [
                      0,
                      -30.928
                    ],
                    [
                      -0.484,
                      -2.963
                    ],
                    [
                      0,
                      -29.306
                    ],
                    [
                      0,
                      0
                    ],
                    [
                      0,
                      0
                    ],
                    [
                      0,
                      0
                    ]
                  ],
                  o: [
                    [
                      -30.201,
                      0
                    ],
                    [
                      -8.378,
                      -4.994
                    ],
                    [
                      -30.928,
                      0
                    ],
                    [
                      0,
                      3.1
                    ],
                    [
                      -27.779,
                      5.25
                    ],
                    [
                      0,
                      0
                    ],
                    [
                      0,
                      0
                    ],
                    [
                      0,
                      0
                    ],
                    [
                      0,
                      0
                    ]
                  ],
                  v: [
                    [
                      116.5,
                      -58.5
                    ],
                    [
                      45.096,
                      -18.585
                    ],
                    [
                      16.5,
                      -26.5
                    ],
                    [
                      -39.5,
                      29.5
                    ],
                    [
                      -38.699,
                      38.583
                    ],
                    [
                      -87.5,
                      97.5
                    ],
                    [
                      -159.5,
                      97.5
                    ],
                    [
                      -159.5,
                      -206.5
                    ],
                    [
                      116.5,
                      -206.5
                    ]
                  ],
                  c: true
                }
              ]
            }
          ],
          ix: 1
        },
        o: {
          a: 0,
          k: 100,
          ix: 3
        },
        x: {
          a: 0,
          k: 0,
          ix: 4
        }
      }
    ]
  }
  return [template]
}
